跳到主要内容

Split

Splits the cell into a given number of rows and columns.

Syntax

expression.Split(oCell, nRow, nCol);

expression - A variable that represents a ApiTable class.

Parameters

NameRequired/OptionalData typeDefaultDescription
oCellOptionalApiTableCellThe cell which will be split.
nRowOptionalNumbertrueCount of rows into which the cell will be split.
nColOptionalNumbertrueCount of columns into which the cell will be split.

Returns

ApiTable | null

Example

This example splits the cell into a given number of rows and columns.

let doc = Api.GetDocument();
let tableStyle = doc.CreateStyle("CustomTableStyle", "table");
tableStyle.SetBasedOn(doc.GetStyle("Bordered"));
let table = Api.CreateTable(3, 3);
table.SetWidth("percent", 100);
table.SetStyle(tableStyle);
doc.Push(table);
let cell = table.GetCell(0, 0);
table.Split(cell, 2, 2);